package JVM;

import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;
import org.omg.Messaging.SYNC_WITH_TRANSPORT;

import java.util.Scanner;

public class Main {
    public static int[][] map;
    public static int M;
    public static int N;
    public static int cx;
    public static int cy;
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int m=scanner.nextInt();
        int n=scanner.nextInt();
        M=m;
        N=n;

        int[][] map_=new int[m][n];
        int s1=scanner.nextInt();
        int s2=scanner.nextInt();
        int e1=scanner.nextInt();
        int e2=scanner.nextInt();
        int barrterCount=scanner.nextInt();
        for (int i=1;i<=barrterCount;i++){
            int x=scanner.nextInt();
            int y=scanner.nextInt();
            map_[x][y]=1;
        }
        map=map_;
        returnType res= process(s1,s2,e1,e2);
        System.out.println(res.count+" "+res.min);
    }

    public static class returnType{
        int count;
        int min;
        public returnType(int count,int min){
            this.count=count;
            this.min=min;
        }
    }

    public static returnType process(int s1,int s2,int e1,int e2){
        //边界
        if (e1<0||e1>=M||e2<0||e2>=N||map[e1][e2]==1)
            return new returnType(0,Integer.MAX_VALUE);
        if (s1==e1&&s2+1==e2)
            return new returnType(1,1);
        if (s1==e1&&s2-1==e2)
            return new returnType(1,1);
        if (s1+1==e1&&s2==e2)
            return new returnType(1,1);
        if (s1-1==e1&&s2==e2)
            return new returnType(1,1);
        if (map[e1][e2]==-1)
            return new returnType(0,Integer.MAX_VALUE);

        //往下递归
        map[e1][e2]=-1;
        returnType res1=process(s1,s2,e1+1,e2);
        returnType res2=process(s1,s2,e1-1,e2);
        returnType res3=process(s1,s2,e1,e2-1);
        returnType res4=process(s1,s2,e1,e2+1);
        map[e1][e2]=0;
        int min=0;
        min=Math.min(res1.min,Math.min(res2.min,Math.min(res3.min,res4.min)));
        int count=0;
        if (min==Integer.MAX_VALUE){
            return new returnType(0,Integer.MAX_VALUE);
        }
        if (res1.min==min)
            count+=res1.count;
        if (res2.min==min)
            count+=res2.count;
        if (res3.min==min)
            count+=res3.count;
        if (res4.min==min)
            count+=res4.count;
        return new returnType(count,min+1);
    }
}
